<?php
/* @var $this SiteController */
/* @var $model ContactForm */
/* @var $form TbActiveForm */

$this->pageTitle=Yii::app()->name . ' - Contact Us';
$this->breadcrumbs=array(
	'Contact',
);
?>

<h1>Contact Us</h1>

<?php if(Yii::app()->user->hasFlash('contact')): ?>

    <?php $this->widget('bootstrap.widgets.TbAlert', array(
        'alerts'=>array('contact'),
    )); ?>

<?php else: ?>

<p>
If you have business inquiries or other questions, please fill out the following form to contact us. Thank you.
</p>

<div class="form">

<?php 

	$form=$this->beginWidget('bootstrap.widgets.BsActiveForm', array(
	//        'layout' => BSHtml::FORM_LAYOUT_HORIZONTAL,
	'id'=>'contact-form',
	'htmlOptions' => array('class' => 'js-ajax-form'),
	'enableClientValidation'=>true,
	'clientOptions'=>array(
		'validateOnSubmit'=>true,
	),
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php //echo $form->errorSummary($model); ?>

    <?php echo $form->textFieldControlGroup($model,'name'); ?>

    <?php echo $form->textFieldControlGroup($model,'email'); ?>

    <?php echo $form->textFieldControlGroup($model,'subject',array('size'=>60,'maxlength'=>128)); ?>

    <?php echo $form->textAreaControlGroup($model,'body',array('rows'=>6)); ?>

	<?php if(CCaptcha::checkRequirements()): ?>
	<div class="control-group">
		<?php echo $form->labelEx($model,'verifyCode',array('class' => 'control-label required')); ?>
		<div class="controls"><div class="captcha"><div class="widget">
		<?php $this->widget('CCaptcha',array('imageOptions' => array('id' => 'js-recaptcha-link'),'buttonOptions' => array('class' => 'js-normal-link'))); ?>
		</div>
		<?php echo $form->textField($model,'verifyCode'); ?>
		
		<div class="hint">Please enter the letters as they are shown in the image above.
		<br/>Letters are not case-sensitive.</div>
		<?php echo $form->error($model,'verifyCode'); ?>
		</div>
		</div>
	</div>
	<?php endif; ?>

    <?php
echo BSHtml::submitButton('Submit', array(
    'color' => BSHtml::BUTTON_COLOR_PRIMARY
));
?>
	</div>
<?php $this->endWidget(); ?>

</div><!-- form -->

<?php endif; ?>